package com.joplus.housekeeper.ui.fragment.xmppCustomer;

import android.view.LayoutInflater;
import android.view.View;

import com.joplus.housekeeper.R;
import com.joplus.housekeeper.adapter.OrderAdapter;
import com.joplus.housekeeper.base.BaseFragment2;
import com.joplus.housekeeper.bean.OrderOutBeanNew;
import com.joplus.housekeeper.network.RequestHelper;
import com.joplus.housekeeper.network.TextCallback;
import com.joplus.housekeeper.ui.view.MyListView;

/**
 * Created by zisheng on 2017/9/18.
 */

public class OrderFragment extends BaseFragment2 {

    private MyListView lv;

    @Override
    public View initView(LayoutInflater inflater) {
        return inflater.inflate(R.layout.fragment_customer_order
                , null);
    }

    @Override
    protected void initFindViewById(View view) {
        lv = (MyListView) view.findViewById(R.id.lv);

    }

    @Override
    public void initData() {
        String accountId = getArguments().getString("accountId");
        RequestHelper.getInstance().getorderList(getActivity(), accountId, new TextCallback() {
            @Override
            public void onFailure(String responseString) {

            }

            @Override
            public void onSuccess(Object responseString) {
                OrderOutBeanNew responseString1 = (OrderOutBeanNew) responseString;
                /*if (!responseString1.equals("2000")) {
                    return;
                }*/
                lv.setAdapter( new OrderAdapter(getActivity(), responseString1.getData()));

            }
        });

    }
}
